package org.compiere.model;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Properties;
import java.util.logging.Level;

import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;

public class Mhrmemployeessigned extends X_hrm_employeessigned {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7592095685852879432L;
	/**	Static Logger	*/
	private static CLogger	s_log	= CLogger.getCLogger (Mhrmemployeessigned.class);
	
	public Mhrmemployeessigned(Properties ctx) {
		super(ctx);
	}

	public Mhrmemployeessigned(Properties ctx, int hrm_employeessigned_ID,
			String trxName) {
		super(ctx, hrm_employeessigned_ID, trxName);
	}
	
	public Mhrmemployeessigned(Properties ctx, ResultSet rs, String trxName) {
		super(ctx, rs, trxName);
	}

	@Override
	public boolean saveUpdate() {
		return super.saveUpdate();
	}
	
	public static MBPartner[] getSigningBPartner(){
	
		ArrayList<MBPartner> list = new ArrayList<MBPartner>();
		
		PreparedStatement pstmt = null;
		ResultSet rs = null;
		
		// 
		String sql_ = "SELECT C_BPartner_ID FROM hrm_settingSigning" ;							
		try
		{
			pstmt = DB.prepareStatement(sql_,null);	
			rs = pstmt.executeQuery();	
			while(rs.next()){
				MBPartner bp = new MBPartner(Env.getCtx(), rs.getInt(1), null);
				list.add(bp);	
			}
		}
		catch (SQLException e)
		{
			s_log.log(Level.SEVERE, "product", e);
		}
		finally
		{
			DB.close(rs, pstmt);
			rs = null; pstmt = null;
		}	
		
		return list.toArray(new MBPartner[list.size()]);
	}
	
}
